# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=libkkc
pkgver=0.3.5
pkgrel=3
pkgdesc="Japanese Kana Kanji conversion input method library"
url="https://github.com/ueno/libkkc"
arch="all"
license="GPL-3.0-or-later"
makedepends="
	intltool
	json-glib-dev
	libgee-dev
	libmarisa-dev
	py3-marisa
	"
subpackages="
	$pkgname-dev
	$pkgname-lang
	kkc-package-data
	"
source="https://github.com/ueno/libkkc/releases/download/v$pkgver/libkkc-$pkgver.tar.gz
	$pkgname-py3.patch
	"

prepare() {
	default_prepare

	update_config_guess
	update_config_sub
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--disable-static \
		--disable-silent-rules \
		--disable-vapigen
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install

	mkdir -vp "$pkgdir"/usr/share
	mv -v "$pkgdir"/usr/lib/locale "$pkgdir"/usr/share/
}

data() {
	pkgdesc="$pkgdesc (data downloader script)"

	amove usr/bin
}

sha512sums="
f611c3104a22ad38af29746870849d8937b6af2a7fee0952cc25f36ef845b5617a192df7ca63ff2a507384f7a6a13c9c1b4fa3b9a34f3f041bee8793d04b9236  libkkc-0.3.5.tar.gz
ba74aa8e545d32d40244f86009a49dedb575a6a8dd171baa5fc3e9a7aeac0ea51e4a7e2064a3f2b62f09bfa4751e3a33454a996b0acfe0fab45413dd84881755  libkkc-py3.patch
"
